Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid line copy during LogQL line_format #6104

Merged
merged 1 commit into from
Jun 3, 2022

Conversation

cyriltovena
Copy link
Contributor

This mostly remove an allocation for each line_format specially useful when the result is not used and copied.

This was a todo that was left for a long time.

❯ benchstat beforemetric.txt aftermetric.txt
name                        old time/op    new time/op    delta
_MetricPipelineCombined-16    4.94µs ± 1%    4.86µs ± 1%  -1.50%  (p=0.008 n=5+5)

name                        old alloc/op   new alloc/op   delta
_MetricPipelineCombined-16    2.49kB ± 0%    2.42kB ± 0%  -2.63%  (p=0.008 n=5+5)

name                        old allocs/op  new allocs/op  delta
_MetricPipelineCombined-16      33.0 ± 0%      31.0 ± 0%  -6.06%  (p=0.008 n=5+5)

❯ benchstat beforelog.txt afterlog.txt      
name                  old time/op    new time/op    delta
_PipelineCombined-16    4.94µs ± 2%    4.87µs ± 1%  -1.32%  (p=0.040 n=5+5)

name                  old alloc/op   new alloc/op   delta
_PipelineCombined-16    2.49kB ± 0%    2.42kB ± 0%  -2.63%  (p=0.008 n=5+5)

name                  old allocs/op  new allocs/op  delta
_PipelineCombined-16      33.0 ± 0%      31.0 ± 0%  -6.06%  (p=0.008 n=5+5)

@cyriltovena cyriltovena requested a review from a team as a code owner May 5, 2022 15:30
@grafanabot
Copy link
Collaborator

./tools/diff_coverage.sh ../loki-main/test_results.txt test_results.txt ingester,distributor,querier,querier/queryrange,iter,storage,chunkenc,logql,loki

Change in test coverage per package. Green indicates 0 or positive change, red indicates that test coverage for a package fell.

+           ingester	0%
+        distributor	0%
+            querier	0%
+ querier/queryrange	0%
+               iter	0%
+            storage	0%
+           chunkenc	0%
+              logql	0%
+               loki	0%

1 similar comment
@grafanabot
Copy link
Collaborator

./tools/diff_coverage.sh ../loki-main/test_results.txt test_results.txt ingester,distributor,querier,querier/queryrange,iter,storage,chunkenc,logql,loki

Change in test coverage per package. Green indicates 0 or positive change, red indicates that test coverage for a package fell.

+           ingester	0%
+        distributor	0%
+            querier	0%
+ querier/queryrange	0%
+               iter	0%
+            storage	0%
+           chunkenc	0%
+              logql	0%
+               loki	0%

Copy link
Contributor

@sandeepsukhani sandeepsukhani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants